#include "ModContainer.h"
#include "mlbase.h"

ModContainer::ModContainer(string libraryPath)
{
	m_pLibraryHandle = NULL;
	m_pMod = NULL;
	m_strLibraryPath = libraryPath;

	//Library load flag
	m_pLibraryLoadFlag = boost::shared_ptr<bool>(new bool());
	(*m_pLibraryLoadFlag) = TryLoadLibrary();
}
ModContainer::~ModContainer(void)
{
	UnloadLibrary();
	(*m_pLibraryLoadFlag) = false;
}
bool ModContainer::IsModLoaded()
{
	return (*m_pLibraryLoadFlag);
}
IMod *ModContainer::GetModInterface()
{
	return NULL;
}
string ModContainer::GetModName()
{
	if(!Validate())
		return string("NULL");
	return m_pMod->GetPackageName();
}
bool ModContainer::Validate()
{
	return false;
}